package com.ship.common.core.enums;

/**
 * 消息模块类型枚举
 */
public enum ModuleTypeEnum {
    MODULE_TYPE_1(1, "合同执行"),
    MODULE_TYPE_2(2, "调度优化"),
    MODULE_TYPE_3(3, "船务执行"),
    MODULE_TYPE_4(4, "船舶调度"),
    MODULE_TYPE_5(5, "船运执行"),
    MODULE_TYPE_6(6, "船务管理"),
    MODULE_TYPE_7(7, "商务执行")

    ;

    private final Integer code;
    private final String info;

    ModuleTypeEnum(Integer code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static String getValueByCode(int code) {
        for (ModuleTypeEnum myEnum : ModuleTypeEnum.values()) {
            if (myEnum.getCode() == code) {
                return myEnum.getInfo();
            }
        }
        return null;
    }
}
